package Communication;

import java.io.Serializable;

import org.jbox2d.common.Vec2;

public class Couple implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public int y;
	public int x;
	
	public Couple(){
		this.y = 0;
		this.x = 0;
	}
	public Couple(int y,int x){
		this.y = y;
		this.x = x;
	}
	
	public Couple(Vec2 vec2){
		this.y = (int) vec2.y;
		this.x = (int) vec2.x;
	}
	
	public String toString(){
		return "("+y+","+x+")";
	}

	
	public Couple plus(Couple c){
		return plus(c.y,c.x);
	}
	
	public Couple plus(int y, int x) {
		return new Couple(this.y+y,this.x+x);
	}
	
	public Couple moins(Couple c){
		return moins(c.y,c.x);
	}
	
	public Couple moins(int y, int x) {
		return new Couple(this.y-y,this.x-x);
	}
}
